using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
public class ChooseUI_UICtrl : UI_ctrl {
    private Text coin_label;

    private new void Awake()
    {
        base.Awake();
    }
    void Start() {
        coin_label = view["coin/label"].GetComponent<Text>();
        event_manager.Instance.add_listener("coin_event", OnCoinChange);
	}

    void OnCoinChange(string uname, object udata)
    {
        int coin_num = (int)udata;
        coin_label.text = coin_num.ToString();
    }

    private void OnDestroy()
    {
        event_manager.Instance.remove_listener("coin_event", OnCoinChange);
    }

}
